package com.qifei.xmlg_backend.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 操作日志表
 * </p>
 *
 * @author logs
 * @since 2025-06-17
 */
@ApiModel(value = "Logs对象", description = "操作日志表")
@Data
public class Logs implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @ApiModelProperty("主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户ID
     */
    @ApiModelProperty("用户ID")
    private Long userId;

    /**
     * 用户名
     */
    @ApiModelProperty("用户名")
    private String username;

    /**
     * 操作名称
     */
    @ApiModelProperty("操作名称")
    private String operation;

    /**
     * 请求方法
     */
    @ApiModelProperty("请求方法")
    private String method;

    /**
     * 请求URL
     */
    @ApiModelProperty("请求URL")
    private String url;

    /**
     * 请求IP
     */
    @ApiModelProperty("请求IP")
    private String ip;

    /**
     * 状态码（1=成功，0=失败）
     */
    @ApiModelProperty("状态码（1=成功，0=失败）")
    private Integer status;

    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;



    @Override
    public String toString() {
        return "Logs{" +
                "id = " + id +
                ", userId = " + userId +
                ", username = " + username +
                ", operation = " + operation +
                ", method = " + method +
                ", url = " + url +
                ", ip = " + ip +
                ", status = " + status +
                ", createTime = " + createTime +
                "}";
    }
}
